<?php

namespace App\Params\Backend;

use App\Params\Param;
/**
 * 订单列表查询参数
 *
 * @author: WangBin
 * @date: 2021/7/26
 * @mail: <849850352@qq.com>
 */
class OrderListParams extends Param
{
    public $nickname;
    public $order_bn;
    public $status;
    public $consignee;
    public $mobile;
    public $region;
    public $order_from;
    public $page_size = 20;
    public $page = 1;

    public function rules()
    {
        return [
            'nickname' => 'nullable|string',
            'order_bn' => 'nullable|integer',
            'status' => 'nullable|array',
            'consignee' => 'nullable|string',
            'mobile' => 'nullable|string',
            'region' => 'nullable|string',
            'order_from' => 'nullable|string',
            'page_size' => 'nullable|integer',
            'page' => 'nullable|integer',
        ];
    }

    /**
     * @return mixed
     */
    public function getNickname()
    {
        return $this->nickname;
    }

    /**
     * @param mixed $nickname
     */
    public function setNickname($nickname): void
    {
        $this->nickname = $nickname;
    }

    /**
     * @return mixed
     */
    public function getOrderBn()
    {
        return $this->order_bn;
    }

    /**
     * @param mixed $order_bn
     */
    public function setOrderBn($order_bn): void
    {
        $this->order_bn = $order_bn;
    }

    /**
     * @return mixed
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * @param mixed $status
     */
    public function setStatus($status): void
    {
        $this->status = $status;
    }

    /**
     * @return mixed
     */
    public function getConsignee()
    {
        return $this->consignee;
    }

    /**
     * @param mixed $consignee
     */
    public function setConsignee($consignee): void
    {
        $this->consignee = $consignee;
    }

    /**
     * @return mixed
     */
    public function getMobile()
    {
        return $this->mobile;
    }

    /**
     * @param mixed $mobile
     */
    public function setMobile($mobile): void
    {
        $this->mobile = $mobile;
    }

    /**
     * @return mixed
     */
    public function getRegion()
    {
        return $this->region;
    }

    /**
     * @param mixed $region
     */
    public function setRegion($region): void
    {
        $this->region = $region;
    }

    /**
     * @return mixed
     */
    public function getOrderFrom()
    {
        return $this->order_from;
    }

    /**
     * @param mixed $order_from
     */
    public function setOrderFrom($order_from): void
    {
        $this->order_from = $order_from;
    }

    /**
     * @return int
     */
    public function getPageSize(): int
    {
        return $this->page_size;
    }

    /**
     * @param int $page_size
     */
    public function setPageSize(int $page_size): void
    {
        $this->page_size = $page_size;
    }

    /**
     * @return int
     */
    public function getPage(): int
    {
        return $this->page ? -- $this->page : 0;
    }

    /**
     * @param int $page
     */
    public function setPage(int $page): void
    {
        $this->page = $page;
    }
}
